package com.ssww.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.ssww.dao.ContactDao;
import com.ssww.entity.Contact;
import com.ssww.service.ContactService;
/**
 * 
 * @author 
 *
 */
@Service
public class ContactServiceImpl implements ContactService {
	@Resource
	private ContactDao contactDao;
	
	@Transactional
	public Contact getContactById(Integer id) {
		return contactDao.getContactById(id);
	}
	@Transactional
	public List<Contact> getContactList() {
		return contactDao.getContactList();
	}
	@Transactional
	public int addContact(Contact a) {
		contactDao.addContact(a);
		return 0;
	}
	@Transactional
	public int deleteContact(int id) {
		contactDao.deleteContact(id);
		return 0;
	}
	@Transactional
	public int updateContact(Contact a, int id) {
		contactDao.updateContact(a, id);
		return 0;
	}
	
	
	
}
